package com.th.supcom.pds.impl.manager.impl;


import java.util.List;
import java.util.Map;

import net.carefx.fc.framework.db.manager.GetSequenceHelper;

import org.apache.ibatis.session.RowBounds;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.th.supcom.pds.domain.pojo.PdsSupplyDetail;
import com.th.supcom.pds.domain.vo.PdsSupplyDetailVO;
import com.th.supcom.pds.impl.dao.PdsSupplyDetailMapper;
import com.th.supcom.pds.impl.manager.PdsSupplyDetailManager;

/**
 * PdsSupplyDetail 管理接口实现.
 *
 * 供药单明细表.  
 */
public class PdsSupplyDetailManagerImpl implements PdsSupplyDetailManager
{   
    public static final String TAB_PDS_SUPPLY_DETAIL = "PDS_SUPPLY_DETAIL";
    
    private PdsSupplyDetailMapper m_pdsSupplyDetailMapper;
    
    /**序列生成器.*/
    private GetSequenceHelper m_getSequenceHelper;
    
    /**
     * 默认的构造函数.
     */ 
    public PdsSupplyDetailManagerImpl ()
    {
    	
    }

    /**
     * 获取PdsSupplyDetailMapper.
     *
     * @return PdsSupplyDetailMapper.
     */
    public PdsSupplyDetailMapper getPdsSupplyDetailMapper ()
    {
        return m_pdsSupplyDetailMapper;
    }
     
    /**
     * 注入PdsSupplyDetailMapper.
     * 
     * @param pdsSupplyDetailMapper set pdsSupplyDetailMapper.
     */
     public void setPdsSupplyDetailMapper (PdsSupplyDetailMapper pdsSupplyDetailMapper)
    {
        m_pdsSupplyDetailMapper = pdsSupplyDetailMapper;
    }
    
    /**
     * 获取序列.
     *
     * @return GetSequenceHelper
     */
    public GetSequenceHelper getGetSequenceHelper ()
    {
        return m_getSequenceHelper;
    }

    /**
     * 注入序列.
     *
     * @param getSequenceHelper getSequenceHelper.
     */
    public void setGetSequenceHelper (GetSequenceHelper getSequenceHelper)
    {
        m_getSequenceHelper = getSequenceHelper;
    }
   
    @Override
    public PdsSupplyDetail getPdsSupplyDetailByID (Long id)
    {
        return m_pdsSupplyDetailMapper.getPdsSupplyDetailByID(id);
    }
    
    @Override
    public Long getPdsSupplyDetailSeq ()
    {
        return m_getSequenceHelper.getNextSequenceId (TAB_PDS_SUPPLY_DETAIL);
    }
        
    @Override
    public List<PdsSupplyDetail> findPdsSupplyDetailListByExample (PdsSupplyDetail pdsSupplyDetail)
    {
        return m_pdsSupplyDetailMapper.findPdsSupplyDetailListByExample(pdsSupplyDetail);
    }
    
    @Override
    public int findPdsSupplyDetailCountByExample(PdsSupplyDetail pdsSupplyDetail)
    {
        return m_pdsSupplyDetailMapper.findPdsSupplyDetailCountByExample(pdsSupplyDetail);
    }
    
    @Override
    public List <PdsSupplyDetail> findPdsSupplyDetailListByMap (Map <String, Object> params)
    {
        return m_pdsSupplyDetailMapper.findPdsSupplyDetailListByMap(params);
    }
    
    @Override
    public List <PdsSupplyDetail> findPdsSupplyDetailListWithPageByMap (Map <String, Object> params, Integer offset, Integer limit)
    {
        return m_pdsSupplyDetailMapper.findPdsSupplyDetailListWithPageByMap(new RowBounds (offset, limit), params);
    }
    
    @Override
    public Integer findPdsSupplyDetailCountByMap (Map <String, Object> params)
    {
        return m_pdsSupplyDetailMapper.findPdsSupplyDetailCountByMap (params);
    }
    
    @Override
    public int modifyPdsSupplyDetail(PdsSupplyDetail pdsSupplyDetail)
    {
        return m_pdsSupplyDetailMapper.modifyPdsSupplyDetail(pdsSupplyDetail);
    }
    
    @Override
    public int modifyPdsSupplyDetailByExample(PdsSupplyDetail pdsSupplyDetail)
    {
        return m_pdsSupplyDetailMapper.modifyPdsSupplyDetailByExample(pdsSupplyDetail);
    }
      
    @Override
    public int removePdsSupplyDetailByID (Long id)
    {
        return m_pdsSupplyDetailMapper.removePdsSupplyDetailByID (id);
    }
    
    @Override
    public int removePdsSupplyDetailByMap (Map <String, Object> params)
    {
        return m_pdsSupplyDetailMapper.removePdsSupplyDetailByMap (params);
    }
    
    @Override
    public void addPdsSupplyDetail(PdsSupplyDetail pdsSupplyDetail)
    {  
        Long id=getPdsSupplyDetailSeq ();
        pdsSupplyDetail.setSupplyDetailId (id);
        m_pdsSupplyDetailMapper.addPdsSupplyDetail(pdsSupplyDetail);
    }
    
	/** 日志记录器. */
    public static final Logger s_logger = LoggerFactory.getLogger (PdsSupplyDetailManagerImpl.class);
    
    /** 公司版权信息. */
    public static final String copyright = "Copyright 2015, TH Supcom Corporation";
    
    /** 提交路径. */
    public static final String SCC_BRANCH = "$URL$";
    
    /** 提交日期. */
    public static final String SCC_LAST_MODIFICATION_DATE = "$Date$";
    
    /** 最终修改人员. */
    public static final String SCC_LAST_MODIFIER_NAME = "$Author$";
    
    /** 最终版本号. */
    public static final String SCC_REVISION = "$Revision$";

    @Override
    public void insertBatchPdsSupplyDetail (List <PdsSupplyDetail> list)
    {
        Long id=getPdsSupplyDetailSeq ();
        for (PdsSupplyDetail pdsSupplyDetail : list)
        {
            pdsSupplyDetail.setSupplyDetailId (id);
            id++;
        }
        m_pdsSupplyDetailMapper.insertBatchPdsSupplyDetail (list);
    }

    @Override
    public void updateBatchPdsSupplyDetail (List <PdsSupplyDetail> list)
    {
        
        m_pdsSupplyDetailMapper.updateBatchPdsSupplyDetail (list);
    }

    @Override
    public List <PdsSupplyDetailVO> findPdsSupplyDetailByRcptNo (Map <String, Object> params)
    {
        return m_pdsSupplyDetailMapper.findPdsSupplyDetailByRcptNo (params);
    }

    @Override
    public int modifyPdsSupplyDetailByList (List <PdsSupplyDetailVO> pdsSupplyDetailVOs)
    {
        return m_pdsSupplyDetailMapper.modifyPdsSupplyDetailByList (pdsSupplyDetailVOs);
    }

    @Override
    public List <PdsSupplyDetail> findPdsSupplyDetailListByList (List <PdsSupplyDetailVO> pdsSupplyDetailVOs)
    {
        return m_pdsSupplyDetailMapper.findPdsSupplyDetailListByList (pdsSupplyDetailVOs);
    }

    @Override
    public int modifyPhamBatchNumberByList (List <PdsSupplyDetailVO> pdsSupplyDetailVOs)
    {
        return m_pdsSupplyDetailMapper.modifyPhamBatchNumberByList (pdsSupplyDetailVOs);
    }
}